@extends('admin_system/public/layout')
@section('content')
    <div class="col-xs-12 nav top-nav">
        <p class="float-left nav-path"><strong>当前位置：</strong>分会管理>>订单详情</p>

        <a class="btn-default btn float-right back ml10">返回</a>
        {{--<a class="btn-danger btn float-right" href="{{asset('admin_system/chapter/prisidentEdit')}}">新增会长</a>--}}
    </div>


    <div class="content-box col-xs-12 mt20 pb20 pt20">
        <table class="table table-bordered">
            <tr>
                <th>订单编号：</th>
                <td>{{$orderInfo->chapter_order_id}}</td>
                <th>下单时间：</th>
                <td>{{$orderInfo->add_time}}</td>
            </tr>

            <tr>
                <th>订单总金额：</th>
                <td>{{$orderInfo->total_money}}</td>
                <th>支付金额：</th>
                <td>{{$orderInfo->pay_money}}</td>
            </tr>
            <tr>
                <th>订单类型:</th>
                <td>{{$orderInfo->order_type_name}}</td>
                <th>订单提交人:</th>
                <td>{{$orderInfo->user_name}}【{{$orderInfo->user_mobile}}】</td>
            </tr>

            @if($orderInfo->order_type == 'clo')
                <tr>
                    <th>新学习官姓名:</th>
                    <td>{{$orderInfo->new_member_name}}</td>
                    <th>新学习官手机号:</th>
                    <td>{{$orderInfo->new_member_mobile}}</td>
                </tr>
            @endif
            @if($orderInfo->order_type == 'member')
                <tr>
                    <th>新会员姓名:</th>
                    <td>{{$orderInfo->new_member_name}}</td>
                    <th>新会员手机号:</th>
                    <td>{{$orderInfo->new_member_mobile}}</td>
                </tr>
            @endif


            @if($orderInfo->order_type == 'prisident')
                <tr>
                    <th>新会长姓名:</th>
                    <td>{{$orderInfo->new_member_name}}</td>
                    <th>新会长手机号:</th>
                    <td>{{$orderInfo->new_member_mobile}}</td>
                </tr>
            @endif


            @if($orderInfo->order_type == 'company')
                <tr>
                    <th>新公司名称:</th>
                    <td>{{$orderInfo->new_company_name}}</td>
                    <th>新公司信用编号:</th>
                    <td>{{$orderInfo->new_company_code}}</td>
                </tr>
            @endif

            <tr>
                <th>订单确认状态:</th>
                <td colspan="3">
                    <table class="table table-bordered">
                        <tr class="info">
                            <th>相关受益人</th>
                            <th>受益人名称</th>
                            <th>返点百分比</th>
                            <th>返点金额</th>
                            <th>操作信息</th>
                        </tr>

                        <tr class="danger">

                            <th>会长/发起人</th>
                            <td>{{$handInfo['prisidentHandInfo']->YourName}}</td>
                            <td>{{$handInfo['prisidentHandInfo']->incomePercent}}%</td>
                            <td>{{$handInfo['prisidentHandInfo']->incomeMoney}}</td>
                            <td>
                                @if($handInfo['prisidentHandInfo']->isHand == 0)
                                    <span class="btn btn-danger">未处理</span>
                                @else
                                    <span>已处理</span>
                                    <span>{{$handInfo['prisidentHandInfo']->add_time}}</span>
                                @endif
                            </td>
                        </tr>


                        <tr class="active">
                            <th>学习官</th>
                            <td>{{$handInfo['drpHandInfo']->YourName}}</td>
                            <td>30%</td>
                            <td>{{$handInfo['drpHandInfo']->incomeMoney}}</td>
                            <td>
                                @if($handInfo['drpHandInfo']->isHand == 0)
                                    <span class="btn btn-danger">未处理</span>
                                @else
                                    <span>已处理</span>
                                    <span>{{$handInfo['drpHandInfo']->add_time}}</span>
                                @endif
                            </td>
                        </tr>



                        <tr class="danger">
                            @if($handInfo['parentDrpHandInfo'] != false)
                                <th>父一级学习官</th>
                                <td>{{$handInfo['parentDrpHandInfo']->YourName}}</td>
                                <td>10%</td>
                                <td>{{$handInfo['parentDrpHandInfo']->incomeMoney}}</td>
                                <td>
                                    @if($handInfo['parentDrpHandInfo']->isHand == 0)
                                        <span class="btn btn-danger">未处理</span>
                                    @else
                                        <span>已处理</span>
                                        <span>{{$handInfo['parentDrpHandInfo']->add_time}}</span>
                                    @endif
                                </td>
                            @else
                                <th>父一级学习官</th>
                                <td colspan="4">无</td>
                            @endif
                        </tr>



                        @if($handInfo['mishuHandInfo'] != false)

                            <tr class="danger">
                                @if($handInfo['mishuHandInfo'] != false)
                                    <th>小秘书</th>
                                    <td>{{$handInfo['mishuHandInfo']->YourName}}</td>
                                    <td>{{$handInfo['mishuHandInfo']->percent}}%</td>
                                    <td>{{$handInfo['mishuHandInfo']->incomeMoney}}</td>
                                    <td>
                                        @if($handInfo['mishuHandInfo']->isHand == 0)
                                            <span class="btn btn-danger">未处理</span>
                                        @else
                                            <span>已处理</span>
                                            <span>{{$handInfo['mishuHandInfo']->add_time}}</span>
                                        @endif
                                    </td>
                                @else
                                    <th>父二级学习官</th>
                                    <td colspan="4">无</td>
                                @endif
                            </tr>
                        @endif
                        <tr class="danger">
                            <th>总部</th>
                            <td colspan="4">
                                @if($orderInfo->company_check_status == 0)

                                    <form class="form-inline">
                                        <div class="form-group">
                                            <input id="check-msg" type="text" class="form-control" placeholder="备注信息">
                                        </div>

                                        <div class="form-group">
                                            <label class="btn btn-danger">
                                                <span>通过</span>
                                                <input  type="radio" value="1" name="company-check-result" checked/>
                                            </label>

                                            <label class="btn btn-default">
                                                <span>失败</span>
                                                <input  type="radio" value="0" name="company-check-result"/>
                                            </label>
                                        </div>
                                        <span  class="btn btn-primary" onclick="check_chapter_order()">提交审核</span>
                                    </form>
                                @elseif($orderInfo->company_check_status == 1)
                                    <span>通过审核，备注：{{$orderInfo->company_check_msg}}</span>
                                @else
                                    <span>未通过审核，备注：{{$orderInfo->company_check_msg}}</span>
                                @endif
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
@endsection
